<?php

namespace privateClass\Dump;

class Runtime {
    private $start_time = 0;
    private $stop_time = 0;

    function __construct() {
    }
    function __destruct() {
    }

    function get_microtime()
    {
        list($usec, $sec) = explode(' ', microtime());
        return ((float)$usec + (float)$sec);
    }

    function start()
    {
        $this->start_time = $this->get_microtime();
    }

    function stop()
    {
        $this->stop_time = $this->get_microtime();
    }

    function spent()
    {
        return round(($this->stop_time - $this->start_time) * 1000, 1).' ms';
    }

}